package www.xpu.edu.app;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

public class Adapter_job6_2 extends ArrayAdapter<Job6> {
    private int id;

    public Adapter_job6_2(Context context, int resource, List<Job6> objects) {
        super(context,resource,objects);
        id = resource;
    }

    @Override
    public View getView(int position,  View convertView,ViewGroup parent) {
        //return super.getView(position, convertView, parent);
        Job6 job6=getItem(position);
        final View view=LayoutInflater.from(getContext()).inflate(id,parent,false);
        TextView text1=view.findViewById(R.id.job6_adapter_text1);
        TextView text2=view.findViewById(R.id.job6_adapter_text2);
        text1.setText(job6.getJobname());
        text2.setText(job6.getAddress()+"\t"+job6.getWage()+"\t"+job6.getTime());
        return view;
    }
}
